<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>Izena eman</title>
    </h:head>
    <h:body>
        <ui:composition template="./WEB-INF/Templates/hasierakoOrria.xhtml">

            <ui:define name="content">
                <h:form>
                    <p:panel header="KirolPlus polikiroldegian izena eman" style="font-size: 16px; text-align: center">  
                        <center>
                            <p:messages id="messages" autoUpdate="true" />
                            <h:panelGrid columns="4" cellspacing="20px">  
                                <h:outputLabel value="NAN: *" for="idBez"></h:outputLabel>  
                                <p:inputText id="idBez" value="#{bezeroZerrenda.bez.id}" autocomplete="true" maxlength="9" required="true"/> 

                                <h:outputLabel value="Izena : *" for="izBez"></h:outputLabel>  
                                <p:inputText id="izBez" value="#{bezeroZerrenda.bez.izena}" maxlength="20" required="true"/>      

                                <h:outputLabel value="Abizena : *" for="abBez"></h:outputLabel>  
                                <p:inputText id="abBez" value="#{bezeroZerrenda.bez.abizena}" maxlength="50" required="true"/> 

                                <h:outputLabel value="Emaila : *" for="emBez"></h:outputLabel>  
                                <p:inputText id="emBez" value="#{bezeroZerrenda.bez.emaila}" maxlength="50" required="true"/> 


                                <h:outputLabel for="pwd1" value="Pasahitza 1: *" />  
                                <p:password id="pwd1" value="#{bezeroZerrenda.bez.pasahitza}" match="pwd2" label="Pasahitza 1" required="true"/>  

                                <h:outputLabel for="pwd2" value="Pasahitza 2: *" />  
                                <p:password id="pwd2" value="#{bezeroZerrenda.bez.pasahitza}" label="Pasahitza 2"/>  



                                <h:outputText value="Tarifa: *" /> 
                                <p:selectOneMenu id="tarBez" value="#{bezeroZerrenda.bez.tarifa}" converter="tarifaConv" required="true">                      
                                    <f:selectItem itemLabel="Tarifa"/>  
                                    <f:selectItems value="#{tarifaZerrenda.zerrenda}" />  
                                </p:selectOneMenu>



                                <h:outputLabel value="Jaiotze Data : *" for="jdBez"></h:outputLabel> 
                                <h:panelGrid>
                                    <p:inputMask id="jdBez" value="#{bezeroZerrenda.bez.jaioData}" mask="9999-99-99" required="true" /> 
                                    <small> <h:outputLabel value="(UUUU-HH-EE)" for="jdBez"></h:outputLabel> </small>
                                </h:panelGrid>

                            </h:panelGrid>
                            <h:panelGrid columns="2">
                                <p:commandButton value="Ezabatu" type="reset"/> 

                                <p:commandButton id="gehitu" value="Izena eman" action="#{bezeroZerrenda.bezeroaGorde()}" onclick="dialog.show()">  
                                    <p:collector value="#{bezeroZerrenda.bez}" addTo="#{bezeroZerrenda.zerrenda}"/>

                                </p:commandButton>

                            </h:panelGrid> 
                        </center>
                    </p:panel>

                    <p:dialog widgetVar="dialog" resizable="false" id="espDlg" showEffect="fade" hideEffect="explode" modal="true">  

                        <h:panelGrid id="espDisplay" cellpadding="4" style="margin:0 auto;">  

                            <h:outputText value="ONGI ETORRI KIROLPLUS POLIKIROLDEGIRA!" /> 
                            <h:outputText value="Izena ematea ondo burutu da." /> 
                              

                        </h:panelGrid>  

                    </p:dialog> 
                </h:form>

            </ui:define>    
        </ui:composition>

    </h:body>
</html>

